﻿using Wicresoft.RDW.Interface;
using Wicresoft.RDW.Model;

namespace Wicresoft.RDW.Business
{
    public class RequestBiz : BaseBiz<Request>, IRequest
    {
        public Request GetById(int id)
        {
            return base.GetByCondition(p => p.RequestId == id);
        }
        public void UpdateRequestById(int requestId, int status, string comments)
        {

            var request = GetById(requestId);
            request.Status = status;
            if (!string.IsNullOrEmpty(comments))
            {
                request.Comments = request.Comments + comments;
            }
            Update(request);

        }
    }
}
